﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/ConvergenceTheme.Master" Inherits="System.Web.Mvc.ViewPage<elfam.web.ViewModels.Cart.EnterShippingDetailsViewModel>" %>
<%@ Import Namespace="elfam.web" %>
<%@ Import Namespace="elfam.web.Extensions" %>
<%@ Import Namespace="elfam.web.Models" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	 - Информация о доставке
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h3>Заказанные товары:</h3>
    
    <table class="box-table-a">
        <tr>
            <th>Название</th>
            <th>Цена</th>
            <th>Количество</th>            
            <th>Сумма</th>
        </tr>
        <% foreach (CartItem item in Model.Cart.Items) {%>
            
            <tr>
                <td><%= item.Product.Name %></td>
                <td><%= item.Product.Price.ToCurrencyString()%></td>
                <td><%= item.Quantity %></td>
                <td><%= item.Summ().ToCurrencyString() %></td>
            </tr>
        
        <%} %>
        
        <tr>
            
            <td colspan="3">Сумма:</td>
            <td><%= Model.Cart.Summ().ToCurrencyString() %></td>
        </tr>
        
        <tr>
            
            <td colspan="3">Сумма со скидкой <%= Model.User.Discount %>%:</td>
            <td><%= Model.Cart.SummDiscount().ToCurrencyString() %></td>
        </tr>
        
    </table>
    
    <a href="/Cart/">Изменить содержимое корзины</a>
    
    <h3>Информация о доставке</h3>
    
    <form action="/Cart/Send/" method="post">
    <div class="input-fields">
        
    <%= Html.EditorFor(x => x.Contact, "ContactEditor") %>
    
    Способ оплаты<br />
    <select name="PaymentType">
        <% foreach (PaymentType payment in Enum.GetValues(typeof(PaymentType))) {%>
            <option value="<%= (int)payment %>"><%= payment.Description(payment)%> </option>
        <% } %>
    </select><br />
    
    Способ доставки<br />
    <select name="DeliverType">
        <% foreach (DeliverType deliver in Enum.GetValues(typeof(DeliverType))) {%>
            <option value="<%= (int)deliver %>"><%= deliver.Description(deliver)%> </option>
        <% } %>
    </select><br />
    <input type="submit" value="Отправить заказ"/>
    </div>
    </form>
</asp:Content>

